<{include file="portal/guideHeader.tpl"}>
<div id="J_areaNav" class="areaNav clearfix"> <{foreach from=$ptype_first key=k item=t}>
    <div class="areaNavLi" data-url="index.php?ctrl=product&tid=<{$t.tid}>" data-class="areaNavLi_<{$t.tid}>" id="J_areaNav_<{$k}>">
        <div class="areaNavLiBg"><{$t.new_name}></div>
    </div>
    <{/foreach}> </div
>
<{if $hasResult}>
<div id="main" role="main">
    <ul id="kooltaoWall">
        <{foreach from=$productListSearch item=p}>
        <li> <a title="<{$p.title}>" href="<{$p.images.image.path}>" rel="lightbox" data-price="<{$p.price}>" data-url="<{$p.url}>" data-shop="<{$p.shop_url}>" data-nick="<{$p.nick}>"> <img class="lazyLoadImg" src="image/grey.gif" data-original="<{$p.images.thumbnail.path}>" width="215px" height="<{$p.images.thumbnail.height}>px"> </a>
            <p>销量:<span class="p-sales"><{$p.sales}></span>来源:<span class="p-tname"><{$p.terms.source.tname}></span>价格:<span class="p-price"><{$p.price}></span></p>
            <p class="p-description"><{$p.description}></p>
            <a class="hidden kool_collection">喜欢</a> </li>
        <{/foreach}>
    </ul>
</div>
<{else}>
<div id="main" role="main">
    <p style="line-height: 50px; text-align:center">你搜索的内容暂时没有，方便先看看其他宝贝呗~</p>
</div>
<{/if}>
<!--加载数据 -->
<script src="util/js/jquery-1.8.2.min.js?v=120927"  type="text/javascript" charset="utf-8"></script>
<script src="util/js/kooltao.min.js?v=120927" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript"  charset="utf-8">
    <{if $hasResult}>
    var options = {
        autoResize: true,
        container: $('#main'),
        offset: 10,
        itemWidth: 225,
        isHasTag:false
    }
    <{/if}>
    $(document).ready(new function() {
        <{if $hasResult}>
        var handler = $('#kooltaoWall li');
        handler.wookmark(options);
        var elem;
        var aCollection ;
        $(handler).hover(function(){
            elem = $(this);
            elem.addClass("kooltao_hover");
            aCollection = $("a.kool_collection",elem);
            aCollection.removeClass("hidden");
        },function(){
            elem.removeClass("kooltao_hover");
            aCollection.addClass("hidden");
        });
        <{/if}>
        //菜单跳转
        var areaNav = $("#J_areaNav");
        var areaNavLi = $("div.areaNavLi",areaNav);
        var elem;
        $(areaNavLi).hover(function(){
            var index = parseInt($(areaNavLi).index(this)+1);
            elem = $(this);
            index -=1;
            $("div.areaNavLiBg",elem).addClass(elem.attr("data-class"));
            $(".areaNav .areaNavLi").removeClass("current").eq(index).addClass("current");
        },function(){
            $("div.areaNavLiBg",elem).removeClass(elem.attr("data-class"));
        });
        $(areaNavLi).click(function(){
            window.location.href = $(this).attr("data-url");
        });
        <{if $hasResult}>
        $(function() {
            $("img.lazyLoadImg").lazyload({effect : "fadeIn"});
        });
        (function() {
            var $backToTopTxt = "返回顶部", $backToTopEle = $('<div class="fn-backToTop"></div>').appendTo($("body"))
                    .text($backToTopTxt).attr("title", $backToTopTxt).click(function() {
                        $("html, body").animate({ scrollTop: 0 }, 120);
                    }), $backToTopFun = function() {
                var st = $(document).scrollTop(), winh = $(window).height();
                (st > 0)? $backToTopEle.show(): $backToTopEle.hide();
                //IE6下的定位
                if (!window.XMLHttpRequest) {
                    $backToTopEle.css("top", st + winh - 160);
                }
            };
            $(window).bind("scroll", $backToTopFun);
            $(function() { $backToTopFun(); });
        })();
        <{/if}>
        //分享网站代码
        $('#J_shareKooltao').hover(function(){
            $('#J_shareProduct').removeClass('hidden');
        },function(){
            $('#J_shareProduct').addClass('hidden');
        });
    });
</script>

<{include file="portal/footer.tpl"}> 